﻿
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ZYLFramework.Manage;
using ZYLFramework.UI;

namespace Game.UI
{
	public class MapItem
	{
		public GameObject Go;
		public Button MapItemBtn;
		public Text StepsText;
		public Image MapItemBg;

		public MapItem(string path,GameObject panel)
		{
			Go = UICommoncs.UIAddChild(path,panel);
			MapItemBtn = Go.GetComponent<Button>();
			StepsText = Go.transform.Find("StepsText").GetComponent<Text>();
			MapItemBg = Go.GetComponent<Image>();
		}
	}
	
    public class AStartPanelView:UIView
    {
        public Text Text;
		public GridLayoutGroup MapPanel;
		public string Path = "Prefabs/UI/";
		public Dictionary<string, string> ItemDict;

        public override void Init()
        {
            var go = Panel.gameObject;
			Text = go.transform.Find("Text").GetComponent<Text>();
			MapPanel = go.transform.Find("ScrollView/Viewport/Content").GetComponent<GridLayoutGroup>();
			ItemDict = new Dictionary<string, string>();
			ItemDict.Add("MapItem",Path+"MapItem");
        }
        
        public MapItem NewMapItem()
        {
	        return new MapItem(ItemDict["MapItem"],MapPanel.gameObject);
        }
    }
}
